<?php
require_once 'lib/config.php';
require_once 'lib/functions.php';

if ($_POST) {
    $username = isset($_POST['username'])?htmlentities($_POST['username'],ENT_QUOTES):'';
    $password = isset($_POST['password'])?md5($_POST['password']):'';
    if ($username == '' || $username=='') {
		msg('请输入用户名或密码');
    } else {
        $user = $db->query("UPDATE `user` set `username` = '{$username}' , `password` = '{$password}' where id=1");
		msg('修改改成','login.php');
    }
}

require_once 'template/'.TPL.'/'.basename(__FILE__);
